﻿using HttpServer.Helpers;
using HttpServer.Mvc;
using HttpServer.Mvc.Controllers;
using BlackBBS.Models.Data;
using System.IO;
using System.Diagnostics;
using System.Configuration;
using System.Collections.Generic;
using System;

namespace BlackBBSWebServer.Home
{
    public class HomeController : Controller
    {
        /// <summary>
        /// Creates a new controller that is a clone of the current one.
        /// </summary>
        /// <returns>A new controller.</returns>
        public override object Clone()
        {
            return this;
        }

        /// <summary>
        /// Default controller method.
        /// </summary>
        /// <returns></returns>
        public IViewData Index()
        {
            var serverRepo = WebRepository.Instance.Repository;

            ViewData["currentSessions"] = Session.CurrentSessions(serverRepo);
            ViewData["callHistories"] = CallHistory.CallHistoryDetails(serverRepo, 50);
            ViewData["todaysCallers"] = CallHistory.TodaysCallers(serverRepo, 50);

            return Render();

        }
    }
}
